#include <iostream>

using namespace std;

template <typename T>
void print_arr(const T& arr)
{
        for (const auto& x : arr)
                cout << x << ' ';
        cout << endl;
}

int main()
{
        const int SIZE = 21;
        int a[SIZE] = {1000};
        // print_arr(a);
        int n;
        cin >> n;
        int N, ret;
        for (int i = 0; i < n; i++)
        {
                ret = 0;
                cin >> a[i];
                for (int j = i; j >= 0; j--)
                {
                        if (a[i] > a[j]) {
                                ret++;
                        }
                }
                cout << ret << endl;
        }
        return 0;
}